<?php

// start the session
session_start();

// start buffering the output
ob_start();

// require the database and login libraries
require_once("database.php");
require_once("liblogin.php");

?>

<html>
<head>
<title>UC Irvine | Professor Assignment System</title>
</head>

<body>

<?php echo createFixedMenu(); ?>

<div id="indexContainer" align="center">

<h3>Professor Assignment System</h3><br />

<p><i>This is the home page.</i></p>

<?php

if(!isLoggedIn())
{
	echo "Boring, right? It's less boring after you log-in.";
}

?>

<br /><br /><br /><br />

<?php

// only display the list of tasks if the user is currently logged-in
if(isLoggedIn())
{
	echo "Would you like to...<br />\n";
	echo "<ul style=\"width:200px;margin-left:auto;margin-right:auto;text-align:left\">\n";
	echo "<li><a href=\"assign_courses.php\">... assign instructors to courses?</a></li>\n";
	echo "<li><a href=\"manage_courses.php\">... add/edit/remove courses?</a></li>\n";
	echo "<li><a href=\"help.php\">... get help with a task?</a></li>\n";
	echo "<li><a href=\"logout.php\">... log out?</a></li>\n";
	echo "</ul><br /><br /><br />\n";
}

?>

<div style="margin-left:auto;margin-right:auto;width:40%">
Site best viewed with <b>Firefox</b>.<br /><br />

<?php

// check if the user is actually using Firefox and annoy him if he isn't
if(stristr($_SERVER['HTTP_USER_AGENT'],"firefox") == FALSE)
{
	echo "<span style='color:red;font-style:bold'>Seriously... </span><a href='http://www.firefox.com' target='_blank'>Firefox</a><br /><br /><br /><br />";
}

?>

</div>

</div>

<?php include("includes/footer.php"); ?>

</body>

</html>

<?php

// print out the buffer
ob_end_flush();

?>